package com.rran.study.designpattern.behavioral.strategy.factory;

import com.rran.study.designpattern.behavioral.strategy.strategy.PayStrategy;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author yy
 * @Type PayActionRepository.java
 * @Desc
 * @date 2020/7/20 12:59
 */
public class PayActionRepository {

    private static Map<String, PayStrategy> payStrategyMap = new ConcurrentHashMap<>();

    public static void storeStrategy(String payName, PayStrategy payStrategy) {
        payStrategyMap.put(payName, payStrategy);
    }

    public static PayStrategy getPayStrategy(String payName) {
        return payStrategyMap.get(payName);
    }
}
